/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.service;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author vacoor
 */
public interface StorageService {

    boolean exists(String id);

    boolean readTo(String id, OutputStream out, boolean closeOut);

    InputStream readAsStream(String id);

    File readAsFile(String id);

    // 中断上传时, 删除文件
    String store(InputStream is) throws IOException;

}
